package com.android.common;

 
import com.android.R;
import com.android.R.id;
import com.android.R.layout;
import com.android.R.style;

import android.app.Dialog;
import android.content.Context;
import android.graphics.drawable.AnimationDrawable;
import android.widget.ImageView;
import android.widget.TextView;

public class LoadingDailog extends Dialog {
	ImageView imageView;

	public LoadingDailog(Context context, String msg) {
		super(context, R.style.theme_dialog);
		this.setCanceledOnTouchOutside(false);
		setContentView(R.layout.loading_dialog);
		if (msg != null && !"".equals(msg))
			((TextView) findViewById(R.id.dialog_loading)).setText(msg);
		imageView = (ImageView) findViewById(R.id.loadingImageView);
		AnimationDrawable animationDrawable = (AnimationDrawable) imageView
				.getBackground();
		animationDrawable.setOneShot(false);
		animationDrawable.start();
	} 
	 
	public void UpMsg(String msg) {
		((TextView) findViewById(R.id.dialog_loading)).setText(msg);
	}

}
